import 'package:flutter/material.dart';
import 'package:flutter_example_app/store/index.dart';
import 'package:provider/provider.dart';
import 'package:flutter_example_app/router/index.dart';

void main() {
  runApp(StoreApp());
}
class StoreApp extends StatefulWidget {
  const StoreApp({Key? key}) : super(key: key);

  @override
  _StoreAppState createState() => _StoreAppState();
}

class _StoreAppState extends State<StoreApp> {
  @override
  Widget build(BuildContext context) {
    return MultiProvider(
      providers: [
        ChangeNotifierProvider(create: (_) => Counter()),
      ],
      child:const MyApp()
    );
  }
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return MaterialApp.router(
      debugShowCheckedModeBanner: false,
      // 定义命名路由
      routerConfig: router,
      title: 'WhatsApp',
      theme: ThemeData(
        primaryColor: Color(0xff075E54),
        indicatorColor: Color(0xff25D366),
      ),
    );
  }
}
